import request from '@/utils/request'
import {getToken} from '@/utils/auth'
var token = getToken()
export function getRouters() {
  return request({
    url: '/api/admin/menu-all',
    method: 'get',
  })
}
export function getVisible() {
  return request({
    url: '/menu/list/visible',
    method: 'get',
  })
}
// 列表
export function menuList() {
  return request({
    url: '/api/admin/menu',
    method: 'get',
  })
}
//新增
export function menuAdd(formData) {
  let newData=JSON.stringify(formData);
  return request({
    // url: '/menu/saveOrUpdate',
    url: '/api/admin/menu/add',
    method: 'post',
    data:newData
  })
}
//获取修改菜单
export function getmenuUpdata(id) {
  return request({
    url: '/api/admin/menu/'+id,
    method: 'get',
  })
}
//修改
export function menuUpdata(formData) {
  let newData=JSON.stringify(formData);
  return request({
    url: '/api/admin/menu/edit',
    method: 'post',
    data:newData
  })
}

//删除菜单
export function menuDelete(appointBalanceId) {
  return request({
    url: '/menu/delete/'+appointBalanceId,
    method: 'get',
  })
}

